import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        // 创建BufferedReader对象
        try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in))) {

            System.out.println("Enter text:");
            String line = bufferedReader.readLine(); 
            System.out.println("Input was: " + line);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}